import Vue from 'vue';
import Router from 'vue-router';

const _import = require('./_import_' + process.env.NODE_ENV);

Vue.use(Router);

export const constantRouterMap = [
  {
    path: '/404',
    component: _import('errorPage/404'),
    hidden: true
  },
  {
    path: '/401',
    component: _import('errorPage/401'),
    hidden: true
  },
  {
    path: '/',
    name: 'index',
    component: _import('home/index')
  }
];

export default new Router({
  routes: constantRouterMap
});

/**
 * 路由需要权限
 * @type {*[]}
 */
export const asyncRouterMap = [
  { path: '*', redirect: '/404', hidden: true }
];
